import java.util.Scanner;

/**
 * Created by Administrator on 2017/10/31.
 */
public class test {
    public static void main(String[] args) {
        Stack stack=new StackImpl();
        Scanner scanner=new Scanner(System.in);
        String read=scanner.next();
        for (int i = 0; i <read.length() ; i++) {
            stack.push(read.charAt(i));
        }
        while (!stack.isEmpty())
        {
            System.out.println(stack.pop());
        }
    }
}
